Can I use my MacBook Pro as a second monitor for my 27" iMac?
Yes. Look at Avatron Software on the internet and App Store. AirDisplay is the name of the App. The App's allow you to use one of your Mac screens (or iPad, iPhone, even a PC) as a second monitor. If you want to use 1 keyboard , mouse and trackpad to control both screens then check out ShareMouse.
I reviewed both online and on YouTube before I purchased them. I haven't had any problems.