Documented REST and EJB components and refactored a little bit.